<!-- 审核记录 -->
<template>
  <el-table :data="data.tableData" row-key="id" table-layout="auto" style="width: 100%">
    <el-table-column prop="name" label="栏目名称" width="" />
    <el-table-column prop="level" label="栏目类型" width="">
      <template #default="scope">{{ scope.row.level+'级栏目'}}</template>
    </el-table-column>
    <ma-dict-column prop="approveType" label="类型" dict-type="column_button_permissions"></ma-dict-column>
    <el-table-column prop="parentName" label="上级栏目" width="" />
    <el-table-column prop="description" label="栏目描述" width="" />
    <el-table-column prop="agApprove.creatorName" label="提交人" width="" />
    <el-table-column prop="agApprove.createTime" label="提交时间" width="" />
  </el-table>
  <el-pagination v-model:current-page="pageNum" v-model:page-size="pageSize" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getList" @current-change="getList" style="margin-top: 20px;display:flex;justify-content: flex-end;" />
  <dialogForm ref="dialogFormRef" @resetList="getList"></dialogForm>
</template>
      
      <script setup lang="ts">
import { ref, reactive, onMounted, nextTick } from 'vue'
import { listColumn, editPColumn, editSColumn, deletePColumn, deleteSColumn } from '@/api/allApi'
import dialogForm from './dialogForm.vue'
import { ElMessage, ElMessageBox } from 'element-plus/es'
import { useRouter } from 'vue-router'

// let tableData = reactive([])
const userInfo = JSON.parse(localStorage.getItem('userInfo'))
const pageNum = ref(1) //第几页
const pageSize = ref(10) //每页多少条
const total = ref(0) //总条数
const data = reactive({
	tableData: []
})

onMounted(() => {
	getList()
})

const getList = () => {
	listColumn({
		websiteId: Number(localStorage.getItem('WebsiteId')), //网站id 1：鞍钢官网 2：博物馆
		pageNum: pageNum.value,
		pageSize: pageSize.value,
		approveState: '4'
	}).then((res: any) => {
		if (res.code === 0) {
			data.tableData = res.data.list
			total.value = res.data.total
		} else {
			ElMessage.success(res.msg)
		}
	})
}
const examine = (row: any, status: string) => {}
</script>
      
      <style lang="scss" scoped>
//搭配el-table里的table-layout="auto"属性，再让每一列里的width为空即可展现出适应表格内容的列宽
:deep(.el-table .cell) {
	width: max-content;
	display: inline-block;
}
</style>
      